<%@ include file="/WEB-INF/jsp/header.jsp" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>

<h1>Seznam galerií</h1>
<p>Nyní se zobrazují pouze náhledy galerií. Pokud chcete vidět víc, <a href="<spring:url value="/login" htmlEscape="true" />">přihlaste se</a>.
<p><a href="<spring:url value="/gallery/add" htmlEscape="true" />">Přidat novou galerii (vyžaduje přihlášení)</a></p>


	
<c:choose>
  	<c:when test="${empty galleries}">
  		<p>Dosud nebyly nahrany zadne fotografie</p> 
  	</c:when>
  	<c:otherwise>
  		<c:forEach var="gallery" items="${galleries}">
			<div class="snapshot">
					<h3><a href="<spring:url value="/gallery/show/${gallery.id}" />">${gallery.name}</a></h3>
					<span class="UserName"><a href="<spring:url value="/user/show/${gallery.owner.userName}" />">${gallery.owner.fullName}</a></span> <br>
					<img src="${pageContext.request.contextPath}/uploaded/${gallery.owner.userName}/${gallery.rootFolder}/thumbnails/${gallery.previewFileName}" width="150" />
				</div>
		</c:forEach>
  	</c:otherwise>
</c:choose>



<%@ include file="/WEB-INF/jsp/footer.jsp" %>